package com.googlecode.garbagecan.springsecuritystudy.jaas;

import java.security.Principal;
import java.util.HashSet;
import java.util.Set;
import org.springframework.security.providers.jaas.AuthorityGranter;

public class AuthorityGranterImpl implements AuthorityGranter {

	public Set grant(Principal principal) {
		Set set = new HashSet();
		if (principal.getName().equals("TEST_PRINCIPAL")) {
			set.add("ROLE_ADMIN");
			set.add("ROLE_USER");
		}
		return set;
	}
}
